package o;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;

public class zh {
    private final List<d<?>> ˊ = new ArrayList();

    static final class d<T> {
        private final Class<T> ˊ;
        final sd<T> ˎ;

        d(@NonNull Class<T> cls, @NonNull sd<T> sdVar) {
            this.ˊ = cls;
            this.ˎ = sdVar;
        }

        boolean ॱ(@NonNull Class<?> cls) {
            return this.ˊ.isAssignableFrom(cls);
        }
    }

    public synchronized <Z> void ˎ(@NonNull Class<Z> cls, @NonNull sd<Z> sdVar) {
        this.ˊ.add(new d(cls, sdVar));
    }

    @Nullable
    public synchronized <Z> sd<Z> ˏ(@NonNull Class<Z> cls) {
        sd<Z> sdVar;
        int size = this.ˊ.size();
        for (int i = 0; i < size; i++) {
            d dVar = (d) this.ˊ.get(i);
            if (dVar.ॱ(cls)) {
                sdVar = dVar.ˎ;
                break;
            }
        }
        sdVar = null;
        return sdVar;
    }
}
